inputFile = "input.txt";

data = dlmread (inputFile, ",");

data=rot90(data);

filename = "output.txt";
fid = fopen (filename, "w");
fprintf(fid, "%i,", data);
fclose (fid);